package com.wande.dataplatform.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.wande.common.tenant.core.TenantEntity;
import com.wande.dataplatform.domain.vo.DevInstanceVO;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 数据开发任务实例实体
 *
 * @author wande
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("dp_dev_instance")
@AutoMapper(target = DevInstanceVO.class)
public class DevInstance extends TenantEntity {

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 任务ID
     */
    private Long taskId;

    /**
     * DolphinScheduler实例ID
     */
    private Long dsInstanceId;

    /**
     * 状态: RUNNING, SUCCESS, FAILED, STOPPED
     */
    private String status;

    /**
     * 开始时间
     */
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    private LocalDateTime endTime;

    /**
     * 执行时长(毫秒)
     */
    private Long duration;

    /**
     * 执行日志
     */
    private String logs;

    /**
     * 错误信息
     */
    private String errorMsg;

    /**
     * 结果行数
     */
    private Integer resultRows;
}
